//
//  timer.cpp
//  CodeLab11_uhTime
//
//  Created by Matthew Parker on 4/29/13.
//
//

#include "timer.h"

timer::timer(){
}

timer::timer(long d, int m){
    duration = d;
    mode = m;
}

void timer::trigger(){
    startTime = ofGetElapsedTimeMillis();
    
    active = true;
}

void timer::step(){
    currentTime = ofGetElapsedTimeMillis();
    
    if(currentTime >= startTime + duration){
        active = false;
    }
}

void timer::draw(){
    if(active){
        ofRect(0, 0, 100, 100);
    }
}